/**
 * Created by lixinkun on 2017/4/21.
 */
'use strict';
import {PixelRatio} from 'react-native';

//接口做的不错，可以返回多张图片
export default function getCorrectImageSizeUrl(url) {
    return url + '?imageMogr2/format/png/thumbnail/x' + judgeSuitableSize();
}

//根据屏幕分辨率去获取图片大小
function judgeSuitableSize() {
    switch (PixelRatio.get()){
        case 1:
            return 50;
        case 1.5:
            return 100;
        case 2:
            return 200;
        case 3:
            return 250;
        case 4:
            return 300;
        default:
            return 300;
    }
}